﻿/*
	zealotwms 仓库管理系统
	Copyright (C) 2011  狂热者工作组 
    内容：系统通用日志函数
    时间: 2011-9-21
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Zwms.Data.BusinessObjects;
using Zwms.Client.Helper;

namespace Zwms.Client.InfoSys
{
    public static class SysLogWriter
    {
        public static void WriteOptLog(String objectClass, String objectID, String optKind)
        {
            SysOptLog sysOptLog = new SysOptLog();
            sysOptLog.UserCode = MainForm.CurrentUser.Id;
            ServiceReferenceZwms.ServiceZwmsClient client = new ServiceReferenceZwms.ServiceZwmsClient();
            sysOptLog.LogNo = client.GetCurrentLogNo("RZ");
            sysOptLog.ObjectClass = objectClass;
            sysOptLog.ObjectID = objectID;
            sysOptLog.OptKind = optKind;
           ServiceReferenceZwms.ServiceZwmsClient clientZwms = new ServiceReferenceZwms.ServiceZwmsClient();
            DateTime dtNow = clientZwms.GetCurrentSystemTime();
            sysOptLog.OptDate = CommonHelper.GetDateString(dtNow);
            sysOptLog.OptTime = CommonHelper.GetTimeString(dtNow);
            sysOptLog.Remark = "";
            client.AddOptLog(sysOptLog);
 
        }
    }
}
